package de.openlaboratory.elib.controller;

import java.util.List;

import de.openlaboratory.elib.core.LogManager;
import de.openlaboratory.elib.model.library.Publication;

public class PublicationDAO extends GenericDAOHibernate<Publication, Long>
{

	public PublicationDAO()
	{
		super(Publication.class);
	}

	public Publication find(Long id)
	{
		Publication publication = null;
		
		try
		{
			publication = (Publication) super.find(new Publication(), id);
		}
		catch (Exception p)
		{
			LogManager.logMessage(p.getMessage());
		}
		
		return publication;
	}
	
	public List<Publication> findAll()
	{
		List<Publication> publications = null;

		try
		{
			Publication pub = new Publication();
			
			publications = (List<Publication>) super.findAll(pub);
		}
		catch (Exception p)
		{
			LogManager.logMessage(p.getMessage());
		}

		return publications;
	}
}